﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HookupAppForm.Draw.Models
{
    public class CustomDrawInfo : INotifyPropertyChanged, ICloneable
    {
        public string uid { get; set; }


        private string _ShapeName;
        public string ShapeName
        {
            get
            {
                return _ShapeName;
            }
            set
            {
                _ShapeName = value;
                cc("ShapeName");
            }
        }


        private string _BindDataType;
        public string BindDataType
        {
            get
            {
                return _BindDataType;
            }
            set
            {
                _BindDataType = value;
                cc("BindDataType");
            }
        }

        private string _BindDataProperty;
        public string BindDataProperty
        {
            get
            {
                return _BindDataProperty;
            }
            set
            {
                _BindDataProperty = value;
                cc("BindDataProperty");
            }
        }
        private string _CompareSign;
        public string CompareSign
        {
            get
            {
                return _CompareSign;
            }
            set
            {
                _CompareSign = value;
                cc("CompareSign");
            }
        }

        private string _BindDataVal;
        public string BindDataVal
        {
            get
            {
                return _BindDataVal;
            }
            set
            {
                _BindDataVal = value;
                cc("BindDataVal");
            }
        }
        private int _NO;
        public int NO
        {
            get
            {
                return _NO;
            }
            set
            {
                _NO = value;
                cc("NO");
            }
        }

        private int _ShowHeight = 100;
        public int ShowHeight
        {
            get
            {
                return _ShowHeight;
            }
            set
            {
                _ShowHeight = value;
                cc("ShowHeight");
            }
        }
        private ObservableCollection<DrawEleInfo> _EleList;
        public ObservableCollection<DrawEleInfo> EleList
        {
            get
            {
                return _EleList;
            }
            set
            {
                _EleList = value;
                cc("EleList");
            }
        }

        public  string EleListJsonStr { get; set; }
        public byte[] PreviewImg { get;  set; } 

        public event PropertyChangedEventHandler PropertyChanged;
        public void cc(string name)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
        }

        public object Clone()
        {
            return this.MemberwiseClone();
        }

    }
}
